<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>容器</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Clutter编程" />
    <link rel="up" href="sec-actors.html" title="Chapter 5. Actors" />
    <link rel="prev" href="sec-actors-transformations.html" title="Transformations" />
    <link rel="next" href="sec-actors-events.html" title="事件" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">容器</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="sec-actors-transformations.html"><img src="../icons/prev.png" alt="Prev" /></a> </td>
          <th width="60%" align="center">Chapter 5. Actors</th>
          <td width="20%" align="right"> <a accesskey="n" href="sec-actors-events.html"><img src="../icons/next.png" alt="Next" /></a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="sec-containers"></a>容器</h2>
          </div>
        </div>
      </div>
      <p>
一些 clutter actor 实现了 <code class="classname">ClutterContainer</code> 接口，这些 actor 可以包含自己的子 actor。另外，变换 (transformation)和属性改变也作用于子 actor 。用 <code class="function">clutter_container_add()</code> 函数将 actor 加到 container 中</p>
      <p>
<code class="classname">ClutterStage</code> 就是一个 container，可以包含自己的 actor。<span class="application">Clutter</span> 核心库里另一个 container 是 <code class="classname">ClutterGroup</code>，对于 group 的缩放、旋转和剪切也会作用于子 actor，这会简化代码。
</p>
      <p>
其它 <span class="application">Clutter</span> container 可以在 <span class="application">Tidy</span> toolkit library 中找到。 参考 <a class="link" href="appendix-implementing-actors-containers.html" title="Implementing Container Actors">实现自己的 Container</a> 部分。
</p>
      <p>
        <a class="ulink" href="http://clutter-project.org/docs/clutter/0.8/ClutterContainer.html" target="_top">ClutterContainer Reference</a>
      </p>
      <p>
        <a class="ulink" href="http://clutter-project.org/docs/clutter/0.8/ClutterGroup.html" target="_top">ClutterGroup Reference</a>
      </p>
      <div class="sect2" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="actor-example-containers"></a>示例</h3>
            </div>
          </div>
        </div>
        <p>
下面的例子展示了 <code class="classname">ClutterGroup</code> container 的使用，它有两个子 actor，可以一起旋转。
</p>
        <div class="figure">
          <a id="figure-actor-containers"></a>
          <p class="title">
            <b>Figure 5.3. Group</b>
          </p>
          <div class="figure-contents">
            <div class="screenshot">
              <div>
                <img src="./figures/actor_group.png" alt="Group" />
              </div>
            </div>
          </div>
        </div>
        <br class="figure-break" />
        <p>
          <a class="ulink" href="./examples/actor_group" target="_top">Source Code</a>
        </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="sec-actors-transformations.html"><img src="../icons/prev.png" alt="Prev" /></a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="sec-actors.html">
              <img src="../icons/up.png" alt="Up" />
            </a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="sec-actors-events.html"><img src="../icons/next.png" alt="Next" /></a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Transformations </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">
              <img src="../icons/home.png" alt="Home" />
            </a>
          </td>
          <td width="40%" align="right" valign="top"> 事件</td>
        </tr>
      </table>
    </div>
  </body>
</html>
